﻿using UnityEngine;
using System.Collections;
using System.Reflection;
using System;
namespace System.Reflection.Extension
{
    public static class MethodInfoExtension
    {
        public static void ForEachAttribute(this MethodInfo methodInfo, Action<Attribute> callBack)
        {
            object[] attributes = methodInfo.GetCustomAttributes(true);
            foreach (Attribute attribute in attributes)
                callBack(attribute);
        }
    }
}